package cn.walls1717.wallsmall.cart.config;

import cn.walls1717.wallsmall.cart.interceptor.CartInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * SpringMVC配置
 *
 * @author walls1717
 * @since 2022/11/15 9:45
 **/
@Configuration
public class WebConfig implements WebMvcConfigurer {

    /** 拦截器 */
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new CartInterceptor()).addPathPatterns("/**");
    }
}
